package com.example.poi;

import org.apache.poi.ss.usermodel.Workbook;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class Main {
    public static void main(String[] args) throws IllegalAccessException, IOException {
        User user = new User();
        user.setName("吴少聪");
        user.setSex("男");
        user.setAge("14年");

        List<User> list = new ArrayList<>();
        list.add(user);

        Workbook wb = new ExcelUtils().createWorkbook(list);

        wb.write(new FileOutputStream("aaa.xlsx"));
        wb.close();
    }
}
